﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DAL
{
    public class reportBusiness
    {
        public static DataSet list(string where, string orderby, int pageSize, int pageIndex)
        {
            return DAL.DbHelper.ExecuteDataSetPageSize("*", "vw_report_businessList", where, "rbid", orderby, pageSize, pageIndex);
        }

        public static DataTable create(int adminid, string flag,DateTime receiveDt)
        {
            return DAL.DbHelper.ExecuteDataTable("p_report_business", adminid, flag,receiveDt);
        }

        public static string chkCreate()
        {
            return DAL.DbHelper.ExecuteScalar("p_reportBusiness_chkCreate").ToString();
        }

        public static DataTable getDetailByRbNo(string rbNo)
        {
            return DAL.DbHelper.ExecuteDataTable("p_report_businessByRb",rbNo);
        }

        /// <summary>
        /// 前台供应商供货单查看
        /// </summary>
        /// <param name="rbno">提货单编号；如果为空则表示【预览】</param>
        /// <param name="companyid">供应商编号</param>
        /// <returns></returns>
        public static DataTable getDetailByRbNoCom(string rbno, int companyid)
        {
            return DAL.DbHelper.ExecuteDataTable("p_report_businessByRbCom", rbno, companyid);
        }

        public static DataRow getSMSData()
        {
            return DAL.DbHelper.ExecuteDataRow("[dbo].[p_reportBusiness_SMS_Data]");
        }
    }
}
